package com.zjl.spring.thread;

/**
 * @Auther: zhuangjl
 * @Date: 2021/11/10 15:28
 */
public class ThreadGroupDemo {

    public static void main(String[] args) {
        Thread thread1 = new Thread("thread1");
        System.out.println("没有指定分组thread1线程："+thread1.getThreadGroup());
        System.out.println("主线程的ThreadGroup是否与thread1相等："+(thread1.getThreadGroup()==Thread.currentThread().getThreadGroup()));
        ThreadGroup threadGroup = new ThreadGroup("test");
        Thread thread2 = new Thread(threadGroup,"thread2");
        System.out.println("指定分组的thread1线程："+thread2.getThreadGroup());
    }
}
